#! /usr/bin/env python

FILE = open('champlist.txt','r')
ChampIndex=[]
for i in FILE.readlines():
    i = i.rsplit()

    ChampIndex.append(i[0])


FILE.close()

print """
class Champs():
    def __init__(self,parent):
        self.parent=parent
        self.CHAMPS={}
        self.InitChamps()"""

string ="['"
for i in ChampIndex:
    string += i + "','"

string=string[:-2] + "]"
print "        self.ChampIndex=%s" % (string)
print "        self.CreateLists()"


print """
    def InitChamps(self):"""
for i in ChampIndex:
    print "        self.CHAMPS['%s']=Champ_%s()" % (i,i)


print """
    def GetChamp(self,champid):
        return self.CHAMPS[str(champid)]

    def GetChampCopy(self,champid):
        return copy.deepcopy(self.CHAMPS[str(champid)])

    def CreateLists(self):
        self.ChampList=[]
        self.ChampName2ID={}
        for ChampID in self.ChampIndex:
            self.ChampList.append(self.CHAMPS[ChampID].Name)
            self.ChampName2ID[self.CHAMPS[ChampID].Name]=ChampID

    def GetChampList(self):
        return sorted(self.ChampList)

    def GetChampID(self,name):
        return str(self.ChampName2ID[str(name)])

"""